<template>
  <div>
    <h1>报价信息查询</h1>
    <br>

    <el-select v-model="supplier" placeholder="请选择报价审批状态">
      <el-option label="全部报价" value="-1">
      </el-option>
      <el-option label="未通过" value="0">
      </el-option>
      <el-option label="已通过" value="1">
      </el-option>
    </el-select>


    <el-button type="primary" @click=" query()">搜索</el-button>

    <el-row>
      <el-table :data="goodsList" stripe>
        <el-table-column prop="poNumber" label="采购书编号"></el-table-column>
        <el-table-column prop="goodsNumber" label="商品编号"></el-table-column>
        <el-table-column prop="priceNumber" label="报价书编号"></el-table-column>
        <el-table-column prop="supplierNumber" label="供应商编号"></el-table-column>
        <el-table-column prop="suppllierName" label="供应商名称"></el-table-column>
        <el-table-column label="商品规格" prop="goodsDetail"></el-table-column>
        <el-table-column label="单个报价" prop="sellPrice"></el-table-column>
        <el-table-column label="商品名字" prop="goodsName"></el-table-column>
        <el-table-column label="商品类型" prop="goodsType"></el-table-column>
        <el-table-column label="报价书审批状态" prop="status">
          <template #default="scope">
            {{ this.covertStatus(scope.row.status) }}
          </template>
        </el-table-column>
<!--        <el-table-column label="操作">
          <template #default="scope">
            <el-button type="primary" @click="view(scope.row)"></el-button>
          </template>
        </el-table-column>-->
      </el-table>
      <el-pagination v-model:current-page="curPage" v-model:page-size="pageSize"
                     background :total="total" @current-change="changeCurPage()"></el-pagination>
    </el-row>
    <br>


  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "SalesInformationQuery",
  created() {
    this.query()
  },
  data() {
    return {
      goodsList: [],
      supplier: '-1',
      SQEName: '',
      startTime: '',
      endTime: '',
      pick: false,
      form: {
        clientName: '',
        salesman: '',
        sellTime: '',
        sellPrice: ''
      },
      purchaseInfoList: []
    }

  }, methods: {
    covertStatus(statusCode) {

      if (statusCode === 0) {
        return '未通过'
      }
      if (statusCode === 1) {
        return '正在审核'
      }
      if (statusCode === 2) {
        return '已通过'
      }
    },
    view(scope) {
      this.pick = true
      this.form = scope
      let param = new URLSearchParams()
      param.append("sellId", scope.sellId)

      axios.post("/api/sell/queryAll", param).then(res => {
        this.purchaseInfoList = res.data
      })


    },
    query() {
      let param = new URLSearchParams

      param.append('status', this.supplier)


      axios.post("/apf/priceBook/queryPriceBook", param,{
        'headers': {'token': localStorage.getItem("token")}
      }).then(res => {
        this.goodsList = res.data
      })
    },
    determine() {
      this.pick = false
    }


  }
}
</script>

<style scoped>

</style>